<template>
  <div id="app">
    <Topbar></Topbar>
    <Header></Header>
    <router-view></router-view>
    <transition name="fade">
      <Toast v-show="isShowToast"></Toast>
    </transition>
    <Footer></Footer>
    <Login v-show="isShowLoginModal"></Login>
  </div>
</template>

<script>
import Topbar from '@/components/topbar'
import Header from '@/components/header'
import Footer from '@/components/footer'
import Login from '@/components/login'
import Toast from '@/components/toast'
import {mapState} from 'vuex'
export default {
  name: 'App',
  data() {
    return {
      
    };
  },
  computed: {
    ...mapState({
      // 拿到模块文件夹showLoginModal，的状态名isShowLoginModal
      isShowLoginModal:state=>state.showLoginModal.isShowLoginModal,
      isShowToast:state=>state.showToast.isShowToast
    })
  },
  components: {
    Topbar,Header,Footer,
    Login,Toast
  },
  mounted() {
    console.log(this);
  }
}
</script>

<style>
#app {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* color: #2c3e50; */
  margin-top: 0;
}
.fade-enter{
    opacity: 0;
}
.fade-enter-active{
    transition: opacity 1s;
}
.fade-leave-to{
    opacity: 0;
}
.fade-leave-active{
    transition: opacity 1s;
}
</style>
